<template>
  <div class="home">
    <img alt="Vue logo" src="../assets/logo.png">
    <!-- <button @click="deliverByName()">params传参</button> -->
    <el-row >
      <!-- <el-button v-for="item in getArr"  @click="cli(`${item}}`)" type="primary" size="medium" round>{{item}}按钮</el-button> -->
      <el-button @click="cli(2)" type="primary" size="medium" round>2按钮</el-button>
      <!-- <span :v-for="i in ['1','2']" @click="$router.push('/about/i')">about{{i}}</span> -->
    </el-row>
    {{$route.params.arr}}
    {{getArr}}
    <router-view></router-view>

  </div>
</template>

<script>

// import HelloWorld from '../components/HelloWorld.vue'

export default {
  name: 'HomeView',
  // data () {
  //   return {
  //     arr: null
  //   }
  // },
  props: ['arr'],
  methods: {
    cli: function (num) {
      if (num === 1) this.$router.push('/haha')
      else this.$router.push('/home/child')
    },
    deliverByName () {
      this.$router.push({
        name: 'B',
        params: {
          sometext: '一只羊出没'
        }
      })
    }
  },
  computed: {
    getArr () {
      return this.$route.params.arr
    }
  }
}
</script>
